package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.CharacterSetName;
import com.yanmaohu.yulia.bean.SchemaElement;
import com.yanmaohu.yulia.bean.SchemaQualifiedName;
import com.yanmaohu.yulia.bean.TransliterationSource;

/**
 * @author Bright Lee
 */
public final class TransliterationDefinition implements SchemaElement, SqlSchemaDefinitionStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private SchemaQualifiedName transliterationName;
    private CharacterSetName sourceCharacterSetSpecification;
    private CharacterSetName targetCharacterSetSpecification;
    private TransliterationSource transliterationSource;

    public TransliterationDefinition(int beginIndex,
                                     SchemaQualifiedName transliterationName,
                                     CharacterSetName sourceCharacterSetSpecification,
                                     CharacterSetName targetCharacterSetSpecification,
                                     TransliterationSource transliterationSource) {
        this.beginIndex = beginIndex;
        this.endIndex = transliterationSource.getEndIndex();
        this.transliterationName = transliterationName;
        this.sourceCharacterSetSpecification = sourceCharacterSetSpecification;
        this.targetCharacterSetSpecification = targetCharacterSetSpecification;
        this.transliterationSource = transliterationSource;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public SchemaQualifiedName getTransliterationName() {
        return transliterationName;
    }

    public CharacterSetName getSourceCharacterSetSpecification() {
        return sourceCharacterSetSpecification;
    }

    public CharacterSetName getTargetCharacterSetSpecification() {
        return targetCharacterSetSpecification;
    }

    public TransliterationSource getTransliterationSource() {
        return transliterationSource;
    }

}
